<!DOCTYPE html>
<title>This tests that controls do not fade out when the video is playing remotely.</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../media-controls.js"></script>
<video controls loop></video>
<script>
async_test(function(t) {
    var video = document.querySelector("video");
    video.src = "../content/test.ogv";

    video.onplaying = t.step_func(function() {
        internals.mediaPlayerPlayingRemotelyChanged(video, true);
        runAfterHideMediaControlsTimerFired(function() {
            var controls = mediaControlsButton(video, "panel");
            assert_equals(getComputedStyle(controls).opacity, "1");

            internals.mediaPlayerPlayingRemotelyChanged(video, false);
            runAfterHideMediaControlsTimerFired(function() {
                assert_equals(getComputedStyle(controls).opacity, "0");
                t.done();
            }, video);
        }, video);
    });

    video.play();
});
</script>